<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "{{%hotel}}".
 *
 * @property integer $id
 * @property string $name
 * @property string $province
 * @property string $city
 * @property string $district
 * @property string $address
 * @property string $images
 * @property string $geo
 * @property double $longitude
 * @property double $latitude
 * @property integer $star
 * @property string $tel
 * @property integer $service_time
 * @property integer $hotel_type
 * @property integer $created_at
 * @property integer $updated_at
 */
class Hotel extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%hotel}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['name', 'province', 'city', 'district', 'address'], 'required'],
            [['images', 'geo'], 'string'],
            [['longitude', 'latitude'], 'number'],
            [['star', 'service_time', 'hotel_type', 'created_at', 'updated_at'], 'integer'],
            [['name'], 'string', 'max' => 100],
            [['province', 'city', 'district', 'tel'], 'string', 'max' => 20],
            [['address'], 'string', 'max' => 200]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => '酒店名称',
            'province' => '省份id',
            'city' => '城市id',
            'district' => '区县',
            'address' => '酒店地址',
            'images' => 'Images',
            'geo' => '地理位置(经纬度)',
            'longitude' => 'Longitude',
            'latitude' => 'Latitude',
            'star' => '评级',
            'tel' => '场地热线',
            'service_time' => '服务时间',
            'hotel_type' => '酒店类型',
            'created_at' => '创建时间',
            'updated_at' => '更新时间',
        ];
    }

}
